package ketang2;

import java.util.Scanner;

import static java.lang.Integer.sum;


public class Task5 {
    public static void main(String[] args) {
        System.out.println("");
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        int result = sum(n, m);
        System.out.println("" +result);

        printStar(n,m);
    }

    private static void printStar(int n, int m) {
        for(int i=1;i<=n;i++){
            for(int j=1;j<=m;j++){
                System.out.print("*");
            }
            System.out.println();
        }
    }

    private static int sum(int n,int m) {
        int sum=0;
        for(int i=m;i<=n;i++){
            if(i%2==0);
            {
                sum=sum+i;
            }
        }
        return sum;
    }

}



